home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-25 | 2.4 KB | 103 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CWindowBehavior.cp ©1999 Eric Traut
- // ===========================================================================
-
-
- #include "CWindowBehavior.h"
- #include "CShadowWindow.h"
-
-
- // ---------------------------------------------------------------------------
- // • CWindowBehavior
- // ---------------------------------------------------------------------------
-
- CWindowBehavior::CWindowBehavior(
- CShadowWindow & inShadowWindow)
- : mShadowWindow(inShadowWindow)
- {
- inShadowWindow.AttachBehavior(*this);
- }
-
-
- // ---------------------------------------------------------------------------
- // • ~CWindowBehavior
- // ---------------------------------------------------------------------------
-
- CWindowBehavior::~CWindowBehavior(void)
- {
- }
-
-
- // ---------------------------------------------------------------------------
- // • SyncWithShadowWindow
- // ---------------------------------------------------------------------------
-
- Boolean
- CWindowBehavior::SyncWithShadowWindow(void)
- {
- // Subclasses should override
-
- // Returns true if no synchronizatino was necessary
- return true;
- }
-
-
- // ---------------------------------------------------------------------------
- // • DoIdleTask
- // ---------------------------------------------------------------------------
-
- void
- CWindowBehavior::DoIdleTask(
- Boolean inGNETime)
- {
- #pragma unused (inGNETime)
-
- // Subclasses should override
- }
-
-
- // ---------------------------------------------------------------------------
- // • HandleEvent
- // ---------------------------------------------------------------------------
-
- void
- CWindowBehavior::HandleEvent(
- EventRecord * ioEvent,
- Boolean * ioResult)
- {
- #pragma unused (ioEvent, ioResult)
-
- // Subclasses should override
- }
-
-
- // ---------------------------------------------------------------------------
- // • DetachBehavior
- // ---------------------------------------------------------------------------
-
- void
- CWindowBehavior::DetachBehavior(void)
- {
- CWindowRecord * macWindow = mShadowWindow.GetMacWindow();
- Rect entirePort = {-0x4000, -0x4000, 0x4000, 0x4000};
-
- ::SetPort(reinterpret_cast<GrafPtr>(macWindow));
-
- ::InvalRect(&entirePort);
- }
-
-
- // ---------------------------------------------------------------------------
- // • ShouldEnableRestoreMenu
- // ---------------------------------------------------------------------------
-
- Boolean
- CWindowBehavior::ShouldEnableRestoreMenu(void)
- {
- return true;
- }
-
-
-
-
-